﻿using System.Collections.Generic;
using Redmine.Laptop.Common.Constants;
using Redmine.Laptop.Reports.Factories.ReportBuilderFactories;
using Redmine.Laptop.Reports.Factories.ReportFactories;
using Redmine.Laptop.Reports.Reports;

namespace Redmine.Laptop.Reports
{
    public class ReportDirector
    {
        private readonly IReportBuilderFactory _reportBuilderFactory;

        public ReportDirector()
        {
            _reportBuilderFactory = ReportBuilderFactory.GetInstance(ReportFactory.Instance);
        }

        public Report Construct(Dictionary<string, object> arguments)
        {
            var builder =_reportBuilderFactory.CreateBuilder(arguments[Constant.ArgKeys.Report].ToString());
            return builder.CreateReport(arguments);
        }
    } 
}
